package sample.client.view;


import com.google.gwt.user.client.ui.Widget;
import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.widget.core.client.button.TextButton;
import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer;
import com.sencha.gxt.widget.core.client.container.HorizontalLayoutContainer.HorizontalLayoutData;
import com.sencha.gxt.widget.core.client.form.FieldLabel;

class Utils
{
  static public FieldLabel createFormItem(String s, Widget w) {
    return new FieldLabel(w, s);
  }

  static public HorizontalLayoutContainer createFormItem(String s, Widget w,
      TextButton b)
  {
    FieldLabel fl = createFormItem(s, w);
    HorizontalLayoutContainer p = new HorizontalLayoutContainer();
    p.add(fl, new HorizontalLayoutData(-1, -1, new Margins(0, 10, 0, 0)));
    p.add(b, new HorizontalLayoutData(-1, -1, new Margins(0, 10, 0, 0)));
    return p;
  }

}
